<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>Dom</title>
		<script src="../../py/system.js" type="text/javascript"></script>
		<script src="../../py/system/dom/element.js" type="text/javascript"></script>
		<script src="../../py/system/controls/control.js" type="text/javascript"></script>
		
		<script src="../../common/project/project.js" type="text/javascript"></script>
		<script src="../../common/assets/scripts/default.js" type="text/javascript"></script>
		<script src="../../common/assets/scripts/debug.js" type="text/javascript"></script>
	</head>
	<body>
		<div style="background: yellow;" id="a">
				<div style="background: red; width:200px;" id="aa">s<div style="background: black; color:white" id="aba">sadsd</div></div>
				<div style="background: green;" id="ab">f<input type="button" name="button" id="button" value="子控件" /></div>
			</div>
			<hr>
		<script>
			
			var a = $('a'), aa = $('aa'), aba = $('aba'), ab = $('ab');
			
			var MyControl = Control.extend({
				tpl: '<input type="text">',
				
				init: function(){
					this.dom.value = 'initValue';
				}
			}).addEvents({
				add: {
					add: function(){
						log('add');
					},
					remove: log,
					trigger: log
				}
			});
						
			var ff = new MyControl({
				value:"myValue"
			})
				.on('click', function(){log("3");})
				.on('add', log)
				.renderTo();
				
				gg = ff
				.clone(true)   
				.renderTo();
			
		
		</script>
	</body>
</html>
